import { Record } from 'immutable';
import { combineReducers } from 'redux-immutable';
import { createReduxSagaLoading } from '../saga-loading';
import dataReducer from './data-editor';
import apiReducer from './api/index';

const initialState = Record({
  dataEditor: undefined,
  apiProvider: undefined,
  loading: undefined,
});

export default combineReducers(
  {
    dataEditor: dataReducer,
    apiProvider: apiReducer,
    loading: createReduxSagaLoading(),
  },
  initialState
);
